package com.wangyadong.hobby.front.model.inner;

import com.wangyadong.hobby.front.model.TestCollectionBySpring;
import com.wangyadong.hobby.front.model.WemailRecord;
import com.wangyadong.hobby.front.model.WuserInfo;
import com.wangyadong.hobby.front.model.bean.MyString;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration("testInnerConfiguration")
@Import({WuserInfo.class, WemailRecord.class})
public class TestInnerConfiguration {
    public TestInnerConfiguration() {
    }

    public TestInnerConfiguration(MyString myString) {
        this.myString = myString;
    }

    private MyString myString;

    @Bean
    public TestInnerConfiguration testInnerConfiguration2() {
        MyString myString = myString();
        System.out.println("TestInnerConfiguration--> " + myString.hashCode());
        return new TestInnerConfiguration(myString);
    }

    @Bean
    public TestInnerConfiguration testInnerConfiguration1() {
        MyString myString = myString();
        System.out.println("TestInnerConfiguration--> " + myString.hashCode());
        return new TestInnerConfiguration(myString);
    }

    @Bean
    public MyString myString() {
        return new MyString();
    }
}
